package net.asciiworks.filesyncr {
    import net.asciiworks.filesyncr.controller.CompareDirectoriesCommand;
    import net.asciiworks.filesyncr.controller.StartupCommand;
    
    import org.puremvc.as3.patterns.facade.Facade;

    public class ApplicationFacade extends Facade {
        public static const STARTUP:String = 'startup';

		public static const MENU_CHANGED:String = "menuChanged";

		public static const VOLUMES_CHANGED:String = "volumesChanged";

		public static const SETTINGS_CHANGED:String = "settingsChanged";

        public function ApplicationFacade() {
            super();
        }

        public static function getInstance():ApplicationFacade {
            if (instance == null) {
                instance = new ApplicationFacade();
            }
            return instance as ApplicationFacade;
        }

        public function startup(app:Object):void {
            this.sendNotification(STARTUP, app);
        }

        override protected function initializeController():void {
            super.initializeController();
			this.registerCommand(STARTUP, StartupCommand);
			this.registerCommand(SETTINGS_CHANGED, CompareDirectoriesCommand);
        }

        override public function sendNotification(notificationName:String, body:Object = null, type:String = null):void {
            trace('Sent ' + notificationName);
            super.sendNotification(notificationName, body, type);
        }
    }
}